<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>CodeView Examples</title>
        <script type="text/javascript" src="src/ClassTools.js"></script>
        <script type="text/javascript" src="src/StringTools.js"></script>
        <script type="text/javascript" src="src/Keywords.js"></script>
        <script type="text/javascript" src="src/Comments.js"></script>
        <script type="text/javascript" src="src/Stylesheets.js"></script>
        <script type="text/javascript" src="src/DefaultScanner.js"></script>
        <script type="text/javascript" src="src/CodeView.js"></script>

        <style>
            table {
                width:            100%;
                border-spacing:   5px;
            }

            td {
                background:       #fafafa;
                vertical-align:   top;
                border:           solid 1px black;
            }

            div.code-title {
                font-weight:      bold;
                font-size:        70%;
                background:       #f1f1f1;
            }

            pre {
                margin:           0;
            }
        </style>
    </head>

    <body onload="highlight('pre')">
        <h2>Hello World</h2>
        <table>
        <tr><td><div class="code-title">C++:</div>
        <pre>@@language=c++|style=default|line-numbers=yes
#include &lt;iostream&gt;

int main(int argc, char* argv[]) {
    std::cout &lt;&lt; "hello world!" &lt;&lt; std::endl;
    return 0;
}</pre></td>
        <td><div class="code-title">Java:</div>
        <pre>class HelloWorld {
    public static void main(String[] arguments) {
        System.out.println("hello world!");
    }
}</pre></td></tr>

        <tr><td><div class="code-title">Python:</div>
        <pre>print("hello world!")</pre></td>

        <td><div class="code-title">Free Pascal:</div>
        <pre>@@language=pascal
program HelloWorld;
begin
    writeln('hello world!');
end.
        </pre></td></tr>
        </table>

        <h2>Variables</h2>
        <table>
            <tr><td><div class="code-title">C++:</div>
            <pre>int main(int argc, char* argv[]) {
    int         iValue  = 1024;
    double      dValue  = 3.1415926535;
    int[]       iValues = {1, 2, 4, 16, 25, 36};
    char[]      cValue  = "hello world!";
    std::string cValue2 = "hello world!"; // is an object
    return 0;
}</pre></td>

            <td><div class="code-title">Java:</div>
            <pre>class HelloWorld {
    public static void main(String[] arguments) {
        int     iValue  = 1024;
        double  dValue  = 3.1415926535;
        int[]   iValues = {1, 2, 4, 16, 25, 36};
        String  cValue  = "hello world!"; // is an object
        Integer iValue2 = 1024;           // is an object
    }
}</pre></td></tr>

        <tr><td><div class="code-title">Python:</div>
        <pre>iValue  = 1024
dValue  = 3.1415926535
iValues = [1, 2, 4, 16, 25, 36]
cValue  = "hello world!"</pre></td>

        <td></td>

        </tr>
        </table>

        <h2>Loops</h2>
        <table>
            <tr><td><div class="code-title">C++:</div>
            <pre>int main(int argc, char* argv[]) {
    const int[] iValues = {1, 2, 4, 16, 25, 36};
    const int   size    = sizeof(iValues) / sizeof(int);

    for (int n = 1; n &lt;= size; ++n) {
        std::cout &lt;&lt; n &lt;&lt; " x " &lt;&lt; n &lt;&lt; " = "
                  &lt;&lt; iValues[n-1] &lt;&lt; std::endl;
    }
}</pre>
</td></tr>
        </table>


    </body>
</html>
